package duckHunter.ui;

import java.io.IOException;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import duckHunter.app.GameContext;


/**
 * ScoreCanvas extends Canvas Class 
 * shows the high score of the user while opening the application
 */
public class ScoreCanvas extends Canvas{

	protected void paint(Graphics g) {
		g.setColor(255,255,255);
		g.fillRect(0, 0, getWidth(), getHeight());
		Image intro;
		try {
			intro = Image.createImage("/img/victorious.png");
			g.drawImage(intro, 80,60 , 0);
		}catch (IOException e) {
			e.printStackTrace();
		}
		g.setColor(0,0,0);
		g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM));
		g.drawString("Commander, you wrote history", 20, 190, Graphics.LEFT | Graphics.TOP);
		g.drawString("your high score is: "+GameContext.getInstance().getHighScore(), 20, 210, Graphics.LEFT | Graphics.TOP);
		
		

	}


}
